﻿@{
    Layout = null;
}

<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="zh" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    @Html.Partial("_Title")
    @Html.Raw(ViewBag.CssFile)
</head>
<body class="fixed-top">
    @Html.Partial("_Top")
    <div id="container" class="row-fluid @ViewBag.MenuStatus">
        @Html.Partial("_LeftMenu")
        <div id="body">
            <div id="widget-config" class="modal hide">
                <div class="modal-header">
                    <button data-dismiss="modal" class="close" type="button"></button>
                    <h3>widget Settings</h3>
                </div>
                <div class="modal-body">
                    <p>Here will be a configuration form</p>
                </div>
            </div>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span12">
                        @Html.Raw(ViewBag.NavMenu)
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span12">
                        <div class="widget box light-grey">
                            <div class="widget-title">
                                <h4><i class="icon-globe"></i>编辑报表</h4>
                                <div class="tools">
                                    <a href="javascript:;" class="collapse"></a>
                                    <a href="#widget-config" data-toggle="modal" class="config"></a>
                                    <a href="javascript:;" class="reload"></a>
                                    <a href="javascript:;" class="remove"></a>
                                </div>
                            </div>
                            <div class="widget-body">
                                <div class="row-fluid" style="border: 1px solid #DDDDDD;">
                                    <div class="widget-body form">
                                        <form class="horizontal-form">
                                            <div class="row-fluid">
                                                <div class="span3">
                                                    <div class="control-group">
                                                        <label class="control-label" for="txtReportNum">编号</label>
                                                        <div class="controls">
                                                            <input type="text" id="txtReportNum" name="txtReportNum" class="span12" placeholder="可不填,自动生成" disabled="disabled" value="@ViewBag.Entity.ReportNum" />
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="span3">
                                                    <div class="control-group">
                                                        <label class="control-label" for="txtReportName">报表名称</label>
                                                        <div class="controls">
                                                            <input type="text" id="txtReportName" name="txtReportName" class="span12" placeholder="请输入报表名称" value="@ViewBag.Entity.ReportName" />
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="span3">
                                                    <div class="control-group">
                                                        <label class="control-label" for="ddlReportType">报表类型</label>
                                                        <div class="controls">
                                                            <select id="ddlReportType" name="ddlReportType" class="span12">
                                                                @Html.Raw(ViewBag.ReportType)
                                                            </select>
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="span3">
                                                    <div class="control-group">
                                                        <label class="control-label" for="txtRemark">备注</label>
                                                        <div class="controls">
                                                            <input type="text" id="txtRemark" name="txtRemark" class="span12" placeholder="" value="@ViewBag.Entity.Remark" />
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row-fluid">
                                                <div class="span3">
                                                    <div class="control-group">
                                                        <label class="control-label" for="ddlDsType">数据源类型</label>
                                                        <div class="controls">
                                                            <select id="ddlDsType" name="ddlDsType" class="span12">
                                                                @Html.Raw(ViewBag.DataSourceType)
                                                            </select>
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="span9">
                                                    <div class="control-group">
                                                        <label class="control-label" for="txtDataSource">数据源</label>
                                                        <div class="controls">
                                                            <input type="text" id="txtDataSource" name="txtDataSource" class="span12" placeholder="输入存储过程请回车加载参数" value="@ViewBag.Entity.DataSource" />
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row-fluid">
                                                <div class="span6">
                                                    <div class="control-group">
                                                        <label class="control-label" for="txtFileName">报表文件</label>
                                                        <div class="controls">
                                                            <input type="text" id="txtFileName" name="txtFileName" class="span12" placeholder="" disabled="disabled" value="@ViewBag.Entity.FileName" />
                                                            <span class="help-block"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>

                                <br />
                                <table class="table table-striped table-bordered table-hover" id="tabInfo">
                                    <thead>
                                        <tr class="widget-title">
                                            <th class="hidden-480">参数名</th>
                                            <th class="hidden-480">显示名</th>
                                            <th class="hidden-480">数据类型</th>
                                            <th class="hidden-480">可选值</th>
                                            <th class="hidden-480">默认值</th>
                                            <th class="hidden-480">显示元素</th>
                                            <th class="hidden-480">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>

                                <div class="form-actions formBtn">
                                    <button id="btnUpload" type="button" class="btn btn-primary"><i class="icon-eye-open"></i>上传报表格式</button>
                                    <button id="btnAddParam" type="button" class="btn btn-primary" onclick="ReportManage.ShowDialog()"><i class="icon-eye-open"></i>新增参数</button>
                                    <button type="submit" class="btn btn-primary" onclick="ReportManage.Save()"><i class="icon-ok"></i>保存</button>
                                    <button type="button" class="btn" onclick="orderProduct.Cancel()">取消</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    @Html.Partial("_Foot")

    <script type="text/javascript">
        $(document).ready(function () {
            ReportManage.UploadCheck();
            ReportManage.LoadData();
            $('#txtDataSource').keydown(function (e) {
                if (e.keyCode == 13) {
                    ReportManage.GetMetadata();
                }
            });
        });
    </script>
</body>

</html>
